<template>
	<view class="">
		<view class="sel">
			<input type="text" placeholder="请输入要搜索的内容~" class="select">
			<text class="but" @click="Select">搜索</text>
		</view>
		<view v-if="data.list.length<=0">
			<view class="two">
				<view class="sel-del">
					<view class="history">历史搜索</view>
					<image src="../../../static/item/垃圾桶.png" class="img"></image>
				</view>
				<view class="item">
					<text class="t">自行车</text>
					<text class="t">厨房用品</text>
					<text class="t">摩托</text>
					<text class="t">玉漱</text>
					<text class="t">雨伞</text>
					<text class="t">电风扇</text>
					<text class="t">热水壶</text>
					<text class="t">盆栽</text>
					<text class="t">绿植</text>
					<text class="t">座椅</text>
					<text class="t">桌椅</text>
					<text class="t">钓鱼竿</text>
				</view>
				<view class="history" style="margin-top: 8px;">猜你想搜</view>
				<view class="item">
					<text class="t">xxx</text>
					<text class="t">哈哈</text>
					<text class="t">摩托</text>
					<text class="t">玉漱</text>
					<text class="t">雨伞</text>
					<text class="t">电风扇</text>
					<text class="t">热水壶</text>
					<text class="t">盆栽</text>
					<text class="t">绿植</text>
					<text class="t">座椅</text>
					<text class="t">桌椅</text>
					<text class="t">钓鱼竿</text>
				</view>
			</view>
		</view>

		<view v-if="data.list.length>=1" class="filter">
			<text>时间</text>
			<text>价格</text>
			<text>浏览</text>
			<text>兴趣</text>
		</view>
		<view v-if="data.list.length>=1" class="items" v-for="i in 8" :key="i">
			<image src="../../../static/item/gagerg.jpg" class="imgs" />
			<view class="texts">
				<text class="text">外出无法照顾，过年回老家带不走...</text>
				<view style="display: flex;justify-content: space-between;">
					<text style="color: red;">￥888</text>
					<text>40人喜欢</text>
				</view>
				<image src="../../../static/item/9e19ad4e47d02d5bed982db8adf939a.jpeg" class="img2s" />
				<text>爱笑的女孩</text>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		reactive
	} from 'vue'
	let data = reactive({
		//搜索的结果数据存放的容器
		list: [],
	})
	//点击搜索
	let Select = () => {
		data.list.push('111')
	}
</script>

<style scoped>
	.text {
		font-weight: 600;
	}

	.img2s {
		width: 30px;
		height: 30px;
		border-radius: 50%;
		margin-top: 39%;
		margin-left: 3%;
	}

	.items {
		/* width: 100vw; */
		display: flex;
		margin: 8px 0 0 0;
		padding: 0 8px 0 8px;
	}

	.item {
		display: flex;
	}

	.imgs {
		width: 53vw;
		height: 42vw;
		border-radius: 8px;
	}

	.filter {
		display: flex;
		justify-content: space-between;
		padding: 5px 21px;
	}

	.sel-del {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.img {
		width: 23px;
		height: 23px;
		margin-right: 10px;
	}

	.two {
		padding: 8px 0 8px 12px;
	}

	.item {
		display: flex;
		flex-wrap: wrap;
		padding: 0 8px 0 0;
	}

	.t {
		margin: 8px 5px;
	}

	.history {
		font-weight: 600;
		/* margin-left: 1%; */
		padding: 8px 0 8px 3px;
	}

	.sel {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 6px 17px 6px 17px;
	}

	.select {
		border: 1px solid #e8eaed;
		border-radius: 13px;
		padding: 8px 0 8px 8px;
		width: 78vw;
	}

	.but {
		font-size: 19px;
	}
</style>